#include <stdio.h>
#include <stdafx.h>
#include <curl/curl.h>
#include <string>
using std::string;
#include <base64.h>
#include "AES128.h"


class ml_client {

public:
     
     ml_client(char *client_id, char *client_key);
     ~ml_client();

	 void login(char *uname, char *pw);
	 void addAccount(char *site, char *uname, char *pw);
	 void logout();
     char *getSessionId();
     char *getSessionKey();
     int UrlEncode(const char *source, char *dest, unsigned max);

private:

     char *id;
	 char *ckey;
	 char *session_id;
	 char *session_key;
	 char *status;
	 bool login_status;
	 string url_h;
	 AES128 aes;

     bool sendHTTP(char *url);
	 void parseResponse(char *res);
     

};